package com.song.tox_demo.main;

import android.app.Application;
import android.content.Context;
import android.content.pm.ApplicationInfo;

import com.song.tox_demo.utils.CrashHandler;
import com.yolanda.nohttp.NoHttp;
import com.yolanda.nohttp.cache.DBCacheStore;

/**
 * Created by Administrator on 2017/8/29 0029.
 */

public class App extends Application {

    private static App mInstance;
    private static Context context;


    public static App getInstance() {
        return mInstance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        mInstance = this;
        context = getApplicationContext();


        initCrachHandler();
        initNohttp();

    }

    private void initNohttp() {
        NoHttp.initialize(this,new NoHttp.Config().setCacheStore(new DBCacheStore(this).setEnable(false)));
    }


    private void initCrachHandler() {
        CrashHandler catchHandler = CrashHandler.getInstance();
        catchHandler.init(getApplicationContext());
    }

}
